package com.mingqijia.gassafety.authority.api.req.company;

import com.mingqijia.gassafety.shared.constant.Constants;
import com.mingqijia.gassafety.shared.cqrs.AuthoritySupportReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;

/**
 * 创建企业请求
 * @author Damon S.
 * @version v0.2
 * @date 2021-06-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "创建企业请求")
public class CreateCompanyReqDTO extends AuthoritySupportReq implements Serializable {

    @NotEmpty(message = "省/市不能为空")
    @ApiModelProperty(value = "省/市", required = true)
    private List<String> divisionId;

    @NotNull(message = "企业名称不能为空")
    @ApiModelProperty(value = "企业名称", required = true)
    @Pattern(regexp = Constants.REGEXP_NAME, message = "企业名称应满足2-16位汉字、字母、数字、下划线")
    private String name;

    @NotNull(message = "企业简称不能为空")
    @ApiModelProperty(value = "企业简称", required = true)
    @Pattern(regexp = Constants.REGEXP_NAME, message = "企业简称应满足2-16位汉字、字母、数字、下划线")
    private String alias;

    @NotNull(message = "组织类型不能为空")
    @ApiModelProperty(value = "组织类型[字典取值]", required = true)
    @Pattern(regexp = "^[a-zA-Z]{5,30}$", message = "组织类型不合法")
    private String type;

    @ApiModelProperty(value = "父级企业")
    private String parentId;

    @ApiModelProperty(value = "企业属性[字典取值]")
    @Pattern(regexp = "^[a-zA-Z]{0,30}$", message = "企业属性不合法")
    private String nature;

    @ApiModelProperty(value = "联系人姓名", required = true)
    @Pattern(regexp = Constants.REGEXP_NAME, message = "联系人姓名应满足2-16位汉字、字母、数字、下划线")
    private String contact;

    @ApiModelProperty(value = "联系电话", required = true)
    @Pattern(regexp = Constants.REGEXP_PHONE, message = "手机号码不合法")
    private String phone;

    @ApiModelProperty(value = "PC端LOGO", required = true)
    private String pcLogo;

    @ApiModelProperty(value = "移动端LOGO", required = true)
    private String mobileLogo;
}
